package com.wangsan.study.sc.test.hello.simple;

import java.util.concurrent.Future;

public class HelloService {
    //    public static String sayHello(final String name) {
    //        return String.format("Hello %s!", name);
    //    }

    /**
     * sayHello under protection of Hystrix
     *
     * @param name
     *
     * @return <code>"Hello " + name + "!"</code>
     */
    public static String sayHello(final String name) {
        return new SayHelloCommand(name).execute();
    }

    /**
     * call async
     *
     * @param name
     *
     * @return
     */
    public static Future<String> sayHelloAsync(final String name) {
        return new SayHelloCommand(name).queue();
    }
}

